﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Data.Extensions;
using DataCenter.Configuration;
using DataCenter.Model.Model;
using Common.Contract.Customer.Identifier;

namespace DataCenter.Data.DBConfig
{
    public class ShopBilltoConfiguration : DBConfig<ShopBillto>
    {
        public ShopBilltoConfiguration()
            : base(SystemConfiguration.Schema, SystemConfiguration.NamingType, SystemConfiguration.TABLE_PREFIX)
        {
            HasKey(k => new { k.ShopCode, k.BilltoCode });
            Property(c => c.ShopCode).HasMaxLength(10).IsRequired();
            Property(c => c.BilltoCode).HasMaxLength(50).IsRequired();
            Property(c => c.UseFlag).HasMaxLength(1).IsRequired();

            //HasOptional(s => s.Region).WithMany(p => p.ShopInfos).HasForeignKey(k => k.RegId).WillCascadeOnDelete(false); 
        }
    }
}
